<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Session;
use App\Member;
class Register extends Model
{
    protected $keyType = 'string';

    /**
     * 获取用户信息
     */
    public function getUserInfo(){
        //$info = \Tools::find("SELECT * from zhyl_sys_register where id=?",[\Tools::getSession("rid")]);
        return self::find(Session::get('rid'));
    }

    /**
     *获取和member关联模型
     */
    public function member_relation_register(){
        //DB::enableQueryLog();
        //return $this->hasOne('App\Member','register_id');
        return $this->hasOne('App\Member','register_id', 'id');
        //return self::get();//$this->hasOne('App\Member','register_id');
    }

}
